﻿<UserControl x:Class="FIFP.DashBoard.Views.MainDashBoard"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             
    DataContext="{Binding MainPageVM,Source={StaticResource ServiceLocator}}"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="1000">

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF1C2028" Offset="0"/>
                <GradientStop Color="#FF1C202B" Offset="1"/>
                <GradientStop Color="#FF353C48" Offset="0.245"/>
                <GradientStop Color="#FF353C48" Offset="0.78"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid Margin="20,10,20,10">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
           
            <Image Margin="0,0,0,10" Source="/FIFP.DashBoard;component/Images/ADMA.png" Stretch="Fill" Height="40" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Top" Width="264" HorizontalAlignment="Left" Grid.Column="1"/>
            <Grid Margin="0,0,0,10" Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="25*"/>
                    <ColumnDefinition Width="50*"/>
                    <ColumnDefinition Width="25*"/>
                </Grid.ColumnDefinitions>
                
                <RadioButton Name="rdImport" Tag="import" IsChecked="{Binding IsImportChecked}" Content="Import" Margin="0,0,1,0" Style="{StaticResource RadioButtonStyleMenu}">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding NavigationCommand}" 
        							CommandParameter="{Binding ElementName=rdImport}" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </RadioButton>
                <RadioButton Name="rdOptimization" IsChecked="{Binding IsOptimizationChecked}" IsEnabled="{Binding IsIntegrationEnabled}" Tag="optimization" Content="Integration/Optimization" Margin="0,0,1,0" Style="{StaticResource RadioButtonStyleMenu}" Grid.Column="1">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding NavigationCommand}" 
        							CommandParameter="{Binding ElementName=rdOptimization}" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </RadioButton>
                <RadioButton Name="rdScenario" IsChecked="{Binding IsScenarioChecked}" Tag="scenario" Content="Scenario Comparision" Margin="0,0,1,0" Style="{StaticResource RadioButtonStyleMenu}" Grid.Column="2">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <i:InvokeCommandAction Command="{Binding NavigationCommand}" 
        							CommandParameter="{Binding ElementName=rdScenario}" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                </RadioButton>


                <Grid Grid.Column="0" Grid.Row="1" Margin="0,3,0,3" Visibility="{Binding IsSubMenuVisible}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Tag="saveas" Name="btnSaveAs" Content="Save as" Margin="0" Width="140" Style="{Binding SaveAsStyle}" Grid.Column="0">
                        <i:Interaction.Triggers>
                            <i:EventTrigger  EventName="Click">
                                <i:InvokeCommandAction Command="{Binding SaveCommand}" 
        							CommandParameter="{Binding ElementName=btnSaveAs}"  />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
                    <Button Tag="save" Name="btnSave" Content="Save" Margin="0,0,30,0" Width="140" Style="{Binding SaveStyle}" Grid.Column="1">
                        <i:Interaction.Triggers>
                            <i:EventTrigger  EventName="Click">
                                <i:InvokeCommandAction Command="{Binding SaveCommand}" 
        							CommandParameter="{Binding ElementName=btnSave}"  />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>

                </Grid>
                
                <Grid x:Name="OptSubMenu" Grid.Row="1" Grid.Column="1" Margin="0,3,0,3" Visibility="{Binding IsSubMenuVisible}" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="32*"/>
                        <ColumnDefinition Width="36*"/>
                        <ColumnDefinition Width="32*"/>                       
                    </Grid.ColumnDefinitions>




                    <RadioButton Grid.Column="0" Name="rdOverlap" Tag="overlap" IsChecked="{Binding IsOverLapChecked}" Content="Overlap Management" Margin="0,0,1,0" Style="{StaticResource RadioButtonStyleMenu}" Visibility="{Binding IsSubMenuVisible}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <i:InvokeCommandAction Command="{Binding NavigationCommand}" 
        							CommandParameter="{Binding ElementName=rdOverlap}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </RadioButton>
                    <RadioButton Name="rdLinkedShutdown" Tag="shutdown" IsEnabled="{Binding IsLSDEnabled}" IsChecked="{Binding IsLinkedSDChecked}"  Content="Linked Shutdown Management" Margin="0,0,1,0" Style="{StaticResource RadioButtonStyleMenu}" Grid.Column="1" Visibility="{Binding IsSubMenuVisible}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <i:InvokeCommandAction Command="{Binding NavigationCommand}" 
        							CommandParameter="{Binding ElementName=rdLinkedShutdown}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </RadioButton>
                    <RadioButton Name="rdOpMng" Tag="optmng" IsChecked="{Binding IsOptMngChecked}"  Content="Optimization Management" Margin="0,0,1,0" Style="{StaticResource RadioButtonStyleMenu}" Grid.Column="2" Visibility="{Binding IsSubMenuVisible}">
                        
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <i:InvokeCommandAction Command="{Binding NavigationCommand}" 
        							CommandParameter="{Binding ElementName=rdOpMng}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </RadioButton>
                </Grid>

                <Grid Grid.Column="2" Grid.Row="1" Margin="0,3,0,3" Visibility="{Binding IsSubMenuVisible}"></Grid>

            </Grid>
            <Grid Grid.Row="2" Name="grdChild" Grid.Column="1">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Loaded">
                        <i:InvokeCommandAction Command="{Binding PageLoadCommand}" 
        							CommandParameter="{Binding ElementName=grdChild}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Grid>
        </Grid>
       
    </Grid>
</UserControl>
